/**
*
*	\file	irq.h
*	\author Manish Shakya 
*	\brief
*	\date  Tuesday,October 27,2009
*	\version 1.0
*
*
*/
#ifdef __IRQ__


#include "inttypes.h"
//#define VIC_SIZE	32
//#define I_Bit			0x80
//#define F_Bit			0x40

//#define SYS32Mode		0x1F
//#define IRQ32Mode		0x12
//#define FIQ32Mode		0x11

//#define HIGHEST_PRIORITY	0x01
//#define LOWEST_PRIORITY		0x0F


#define VIC_BASE_VECT_ADDR 0xFFFFF100
#define VIC_BASE_CTRL_ADDR 0xFFFFF200

#define	WDT_INT			0
#define SWI_INT			1
#define ARM_CORE0_INT	2
#define	ARM_CORE1_INT	3
#define	TIMER0_INT		4
#define TIMER1_INT		5
#define UART0_INT		6
#define	UART1_INT		7
//#define	PWM0_1_INT		8
#define I2C0_INT		9
#define SPI0_INT		10			/* SPI and SSP0 share VIC slot */
//#define SSP0_INT		10
#define	SSP1_INT		11
#define	PLL_INT			12
#define RTC_INT			13
#define EINT0_INT		14
#define EINT1_INT		15
#define EINT2_INT		16
//#define EINT3_INT		17
#define	ADC0_INT		18
#define I2C1_INT		19
//#define EMAC_INT		21
//#define USB_INT			22
//#define CAN_INT			23
//#define MCI_INT			24
//#define GPDMA_INT		25
#define TIMER2_INT		26
#define TIMER3_INT		27
//#define UART2_INT		28
//#define UART3_INT		29
//#define I2C2_INT		30
//#define I2S_INT			31

#define VIC_SIZE		32



#define CLR_VECTADDR() {VICVectAddr=0;}

#define RETURN_EXT0()	{EXTINT=0x01<<0;CLR_VECTADDR();}
#define RETURN_EXT1()	{EXTINT=0x01<<1;CLR_VECTADDR();}
#define RETURN_EXT2()	{EXTINT=0x01<<2;CLR_VECTADDR();}

#define RESET_T0MR0()	{ T0IR=0x01<<0;}
#define RESET_T0MR1()	{ T0IR=0x01<<1;}
#define RESET_T0MR2()	{ T0IR=0x01<<2;}
#define RESET_T0MR3()	{ T0IR=0x01<<3;}
#define RETURN_TIMER0()	{CLR_VECTADDR();}

#define RESET_T1MR0()	{ T1IR=0x01<<0;}
#define RESET_T1MR1()	{ T1IR=0x01<<1;}
#define RESET_T1MR2()	{ T1IR=0x01<<2;}
#define RESET_T1MR3()	{ T1IR=0x01<<3;}
#define RETURN_TIMER1()	{CLR_VECTADDR();}

void irq_init( void );
void irq_install(uint32_t , void (*int_handler)(void) __irq);
#endif /* end __IRQ_H */

/******************************************************************************
**                            End Of File
******************************************************************************/

